﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;


//Alon
namespace InformationExtraction
{
    class IsAliveProcess : ExtractorProcess
    {
        public override void Execute(Person person, Page page)
        {            
            if (BirthdayProcess.GetDatesInBracket(page.Sentences[0].PlainText).Length > 1)
            {
                person.isAlive = false;
                return;
            }
            Regex isBorn = new Regex(@"-LRB-.*?\bborn\b.*?-RRB-", RegexOptions.IgnoreCase);
            if (isBorn.IsMatch(page.Sentences[0].PlainText))
            {
                person.isAlive = true;
                return;
            }
        }
    }
}
